package com.kingboy.kbg.uums.repository.authority.dao;

import com.kingboy.kbg.core.common.base.dao.BaseDao;
import com.kingboy.kbg.uums.repository.authority.example.AdminResourcesExample;
import com.kingboy.kbg.uums.constant.ResourcesType;
import com.kingboy.kbg.uums.entity.authority.po.AdminResources;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Create By 郭金宝 on 2018/6/12.<br>
 */
public interface AdminResourcesMapper extends BaseDao<Long, AdminResources, AdminResourcesExample> {
    /**
     * 查询子菜单和子资源数量
     *
     * @param appId
     * @param id
     * @return
     */
    int countChildren(@Param("appId") String appId, @Param("id") Long id);

    int checkMenu(@Param("appId") String appId, @Param("menuGroupId") Long menuGroupId);

    List<AdminResources> findResourcesByApplicationId(@Param("appId") String appId,
                                                      @Param("menuGroupCode") String menuGroupCode,
                                                      @Param("resourcesTypeList") List<ResourcesType> resourcesTypeList);
}